package artexercise;

public class AdditionExpression extends ArithmeticExpression {

    public AdditionExpression(int operand1, int operand2) {
        super(operand1, operand2);
        this.operator = "+";
    }

    @Override
    public void calculate() {
        this.result = operand1 + operand2;
    }

    @Override
    public boolean isValid() {
        return result >= 0 && result <= 100; // 限制结果范围
    }
}